TIPs for event driven programming:
- Always put IO in different thread, otherwise block the whole process.
- Never loop a contain that may protentially change during the loop. IF necessary, do a deepcopy
- Use locks to make sure evety thing is static during the handling the event.